<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with n-th line]]></title><description><![CDATA[A list of topics that have been tagged with n-th line]]></description><link>https://community.secnto.com//tags/n-th line</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 22:43:50 GMT</lastBuildDate><atom:link href="https://community.secnto.com//tags/n-th line.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[How to iterate over every n-th line from a file?]]></title><description><![CDATA[Demo:
data.txt:
line1
line2
line3
line4
line5
line6
line7
line8
line9
line10
line11
line12
line13

Code:
from itertools import islice

with open('data.txt') as f:
    for line in islice(f, 3, None, 3):
        print line,  # Python3: print(line, end='')

Produces:
line4
line7
line10
line13

Reff
]]></description><link>https://community.secnto.com//topic/2097/how-to-iterate-over-every-n-th-line-from-a-file</link><guid isPermaLink="true">https://community.secnto.com//topic/2097/how-to-iterate-over-every-n-th-line-from-a-file</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>